import request from '@/utils/request'

//查询审核状态
export function checkStatus(query){
  return request(({
    url:'/volunteer/event/eventCheckInfo',
    method:'get',
    params:query
  }))
}

//查询活动状态
export function checkEventStatus(query){
    return request(({
      url:'volunteer/event/eventState',
      method:'get',
      params:query
    }))
}

//获取当天活动个数
export function getdayEvent(query){
  return request(({
    url:'volunteer/event/findNumByNowday',
    method:'get',
    params:query
  }))
}


//查询活动状态
export function getEventStatus(query){
  return request({
    url:'/volunteer/event/eventStatus',
    method:'get',
    params:query
  })
}


// 查询活动信息列表
export function listEvent(query) {
  return request({
    url: '/volunteer/event/list',
    method: 'get',
    params: query
  })
}

// 查询已审核活动列表
export function showEvent(query) {
  return request({
    url: '/volunteer/show/list',
    method: 'get',
    params: query
  })
}

// 查询活动下拉树结构
export function treeEventSelect() {
  return request({
    url: '/volunteer/event/treeEventSelect',
    method: 'get'
  })
}

// 查询活动信息详细
export function getEvent(eventId) {
  return request({
    url: '/volunteer/event/' + eventId,
    method: 'get'
  })
}

// 新增活动信息
export function addEvent(data) {
  return request({
    url: '/volunteer/event',
    method: 'post',
    data: data
  })
}

// 修改活动信息
export function updateEvent(data) {
  return request({
    url: '/volunteer/event',
    method: 'put',
    data: data
  })
}

// 删除活动信息
export function delEvent(eventId) {
  return request({
    url: '/volunteer/event/' + eventId,
    method: 'delete'
  })
}

// 管理员审核通过活动
export function checkSuccess(eventId) {
  const data={
    eventId
  }
  return request({
    url: '/volunteer/event/checkSuccess',
    method: 'put',
    params: data
  })
}

// 管理员审核不通过活动
export function checkFail(eventId) {
  const data={
    eventId
  }
  return request({
    url: '/volunteer/event/checkFail',
    method: 'put',
    params: data
  })
}

// 修改部门
export function updateDept(data) {
  return request({
    url: '/system/dept',
    method: 'put',
    data: data
  })
}

//上传图片
export function uploadPicture(data){
  return request({
    url:'volunteer/image/upload',
    method:'post',
    data:data
  })
}

